-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Improve rendering driver fallback on Windows. #112384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve rendering driver fallback on Windows. #112384
Conversation
bruvzg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working as expected, but I tested it only on systems with D3D12 support (by breaking various checks). Ideally, it should also be tested on old hardware w/o D3D12 support, in case something is failing in an unexpected way.
Does OpenGL normally work on your VM if you explicitly switch to it without invoking any fallback? Please try both
I actually have an old laptop with an Intel GPU that supports neither D3D12 or Vulkan, I'll be testing the PR on it. |
|
Supplement, #112293 can normally trigger rendering fallback and display the screen. |
|
Figured the reason for the transparent window. When D3D12 is attempted first, the window gets created with the WS_EX_NOREDIRECTIONBITMAP flag. The flag gets removed on the next style change after the fallback, but this doesn't seem to be something that works consistently. It works on my PC, but doesn't on a VM or the old laptop I just tried. See: https://stackoverflow.com/questions/40576394/setwindowlong-with-gwl-exstyle-and-ws-ex-noredirectionbitmap This may require recreating the window without the flag. So, I should probably tackle this only after the following PR gets merged first: #112344 |
e236272 to
e515739
Compare
|
I've rewritten the RD device initialization code and made it recreate the window if the "no redirection bitmap" flag needs to change, it all works fine on my end now. |
e515739 to
e6f58fe
Compare
e6f58fe to
613c9fb
Compare
|
Thanks! |
|
@blueskythlikesclouds |
|
That appears to be a D3D12 implementation bug, not something that would require falling back to Vulkan. Please confirm that the user's drivers are up to date. If they are, and this problem still happens, you should open a new issue. It would be useful if you could compile a build with this macro set to 1, and make the user run it with the |
|
I think that DX12 buffer issue is already reported to Godot repo |







Fixes #98207.
Fixes #112282.
Currently on Windows, rendering driver fallback only occurs when the rendering context driver fails to initialize. This is insufficient for D3D12, because the D3D12 rendering context driver only creates DXGI objects, which are also used for D3D10/D3D11.
This PR updates the logic to also check whether the rendering device initialization succeeded. So, when
D3D12CreateDevicefails or the device capabilities do not meet the Godot requirements, the device is destroyed and the fallback is attempted instead.If you want to test this artificially, you can force
RenderingDeviceDriverD3D12::_initialize_device()orRenderingDeviceDriverD3D12::_check_capabilities()to return an error code.